﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StockWarnManagement.aspx.cs"
    MasterPageFile="~/Site1.master" Inherits="WebApplication1.InfoManagement.StockWarnManagement" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <style type="text/css">
        .anpager
        {
            font: 14px Arial, Helvetica, sans-serif;
            padding: 10px 20px 10px 0;
            margin: 0px;
        }
        .anpager a
        {
            padding: 1px 6px;
            border: solid 1px #ddd;
            background: #fff;
            text-decoration: none;
            margin-right: 2px;
        }
        .anpager a:visited
        {
            padding: 1px 6px;
            border: solid 1px #ddd;
            background: #fff;
            text-decoration: none;
        }
        .anpager .cpb
        {
            padding: 1px 6px;
            font-weight: bold;
            font-size: 13px;
            border: none;
        }
        .anpager a:hover
        {
            color: #fff;
            background: #ffa501;
            border-color: #ffa501;
            text-decoration: none;
        }
        /* AspNetPager1属性设置: CssClass="anpager" CurrentPageButtonClass="cpb"*/</style>
 <script type="text/javascript">
         function selectAll(obj) {
              var chkall = obj;
              State = chkall.checked;
              elem = chkall.form.elements;
              for (i = 0; i < elem.length; i++) {
                  if (elem[i].type == "checkbox" && elem[i] != chkall.id) {
                      if (elem[i].checked != State) {
                          elem[i].click();
                      }
                  }
              }
          }

</script>
    <div style="width: 100%; text-align: left; height: 759px;">
        <br />
        <br />
        <div style="width: 60%; border: solid 1px black; margin: 0 auto; height: 736px;">
            <br />
            工具室：<asp:DropDownList ID="DropDownList1" runat="server">
            </asp:DropDownList>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 代码：<asp:TextBox ID="TextBox1"
                runat="server"></asp:TextBox>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="Button1" runat="server" Text="查　询" OnClick="Button1_Click" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="Button2" runat="server" Text="预警数量设置" OnClick="Button2_Click" />
            <br />
            <br />
            <hr />
            <br />
            <asp:Button ID="Delall" runat="server" Text="批量删除" onclick="Delall_Click" runat="server" />
            <asp:GridView ID="GridView1" Width="100%" runat="server" AutoGenerateColumns="False"
                BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3"
                CellSpacing="1" GridLines="None" DataKeyNames="ID,Amount,Amount_Warn,Tool_Code"
                AllowPaging="false" OnPageIndexChanging="GridView1_PageIndexChanging" OnRowCancelingEdit="GridView1_RowCancelingEdit"
                OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" 
                EmptyDataText="没有相关数据！" OnRowDataBound="GridView1_RowDataBound">
                <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
                <Columns>
                       <asp:TemplateField>
                        <HeaderTemplate>
                         <input id="CheckAll" type="checkbox" onclick="selectAll(this);" />全选
                        </HeaderTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:CheckBox runat="server" ID="CheckSingle" />
                        </ItemTemplate>
                        <ItemStyle Width="100px" HorizontalAlign="Center"/>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="序号" InsertVisible="False">
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:Label ID="lb" runat="server" Text='<%# this.GridView1.PageIndex * this.GridView1.PageSize + this.GridView1.Rows.Count + 1%>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="工具室">
                        <EditItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("RoomName") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("RoomName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="车间">
                        <EditItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("Work_Shops") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("Work_Shops") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="代码">
                        <EditItemTemplate>
                            <asp:Label ID="Lbl_ToolCode" runat="server" Text='<%# Bind("Tool_Code") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("Tool_Code") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="存储库存数量">
                        <EditItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("Amount") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("Amount") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Amount_Warn" HeaderText="预警数量" />
                    <asp:CommandField HeaderText="更改" ShowEditButton="True" />
                </Columns>
                <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
                <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
            </asp:GridView> 
           <table>
                <tr>
                    <td>
                      总记录：<asp:Label ID="Lbl_RecordsCount" runat="server" Text="Label"></asp:Label>条
                    </td>
                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                     &nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                     &nbsp;
                    </td>
                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                     &nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                     &nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;
                    <td align="right">
                        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_PageChanged"
                            CssClass="anpager" CurrentPageButtonClass="cpb" FirstPageText="首页" LastPageText="尾页"
                            NextPageText="下一页" PrevPageText="上一页" PageSize="10">
                        </webdiyer:AspNetPager>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</asp:Content>
